//
//  ZZNumDebtDetailVC.m
//  新项目
//
//  Created by liGordon on 17/3/16.
//  Copyright © 2017年 刘耀宗. All rights reserved.
//

#import "ZZNumDebtDetailVC.h"
#import "ZZNumDebtDetailCell.h"
static NSString * identifier = @"NumDebtDetailCell";
@interface ZZNumDebtDetailVC ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *menuTable;
@end

@implementation ZZNumDebtDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    _menuTable.delegate = self;
    _menuTable.dataSource = self;
    self.title = @"单位欠款排行";
    [_menuTable registerNib:[UINib nibWithNibName:@"ZZNumDebtDetailCell" bundle:nil]forCellReuseIdentifier:identifier];
    _menuTable.separatorStyle = UITableViewCellSeparatorStyleNone;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 8;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ZZNumDebtDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    
    if (indexPath.row == 0) {
        cell.titleName.text = @"车牌号";
        cell.detailName.text = self.dic[@"PlateNumber"];
    }else if (indexPath.row == 1){
        cell.titleName.text = @"车主姓名";
        cell.detailName.text = self.dic[@"CarOwner"];
    }else if (indexPath.row == 2){
        cell.titleName.text = @"车型";
        cell.detailName.text =self.dic[@"MakeName"];
    }else if (indexPath.row == 3){
        cell.titleName.text = @"联系电话";
        cell.detailName.text = self.dic[@"CarOwnerTel"];
    }else if (indexPath.row == 4){
        cell.titleName.text = @"总维修次数";
        cell.detailName.text =self.dic[@"ReapirNum"];
        
    }else if (indexPath.row == 5){
        cell.titleName.text = @"总费用";
        cell.detailName.text =[NSString stringWithFormat:@"%.2lf",[self.dic[@"AlreadyMoney"] floatValue]];
    }else if (indexPath.row == 6){
        cell.titleName.text = @"当前欠款";
        cell.detailName.text =[NSString stringWithFormat:@"%.2lf",[self.dic[@"Arrears"] floatValue]];
    }else if (indexPath.row == 7){
        cell.titleName.text = @"最后保修日期";
        cell.detailName.text =self.dic[@"RepairTime"];
    }else if (indexPath.row == 8){
        cell.titleName.text = @"服务顾问";
        cell.detailName.text = self.dic[@"ServiceConsultant"];
    }
    
    return cell;
}

@end
